package g_innerclass;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package g_innerclass
 * @date 2024/3/31 下午4:07
 */
public class Test01 {
    public static void main(String[] args) {
        USB usb = method();// USB usb =new Mouse();
        // 创建对象
        usb.open();

    }

    public static USB method() {
        //局部内部类
        class Mouse implements USB {
            public void open() {
                System.out.println("打开鼠标");
            }

        }

        return new Mouse();
    }
}

